<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>登录</title>
    <script src="https://cdn.bootcss.com/jquery/1.12.3/jquery.min.js"></script>
<script>
    //点击刷新验证码
    $(function () {
        $('.captcha').css({
            'cursor': 'pointer'
        });
        // ajax刷新
        $('.captcha').click(function () {
            console.log('click');
            $.get("/refresh",
                function (result) {
                    $('.captcha').attr('src', result['image_url']);
                    $('#id_captcha_0').val(result['key'])
                });
        });
    })
    function re(){
        location.href="/"
    }
</script>
</head>
{% load static %}
<body style="background-image: url({% static 'images/login_4.gif' %});
        background-size:100% 200%;background-repeat:no-repeat;">

	<div id="maxname" style="width:1535px;height:700px;">
      <div id="menu" style="height:700px;width:38%;float:left;">
      </div>

        <div id="content" style="height:300px;width:40%;float:left;margin-top: 230px;background-image: url({% static 'images/login_2.gif' %});background-repeat:no-repeat; background-size:50% 90%">

           <form method="post" action="{% url 'App:user_register' %}"style="margin-top: 50px">
               {% csrf_token %}

               <a style="color: #00a2d4">用户名：</a><input type="text" name="name" autofocus autocomplete="off" required> <br><a style="color: red">{{ error_name }}</a><br>
               <a style="color: #00a2d4">密&nbsp;&nbsp;&nbsp;码：</a><input type="password" name="password" required autocomplete="off"><br>
               <a style="color: #00a2d4">验证码：</a>{{ form.captcha }}<br>
               <a style="color: red">{{ form.captcha.errors }}</a>
               <input type="submit" value="确定" style="width:130px;height:30px;background-color: #d4f8ff">
               <input  type="button" value="返回" onclick="re()" style="width:130px;height:30px;background-color: #d4f8ff">
           </form>

        </div>

  </div>

</body>
</html>